package com.gjy.design.decorator.s2.demo;

import com.gjy.design.decorator.s2.DynamicProxyDecorators;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-10 10:23:34
 */
public class DemoProxy {

    public static void main(String[] args) {
        DataProvider impl = new DataProviderImpl();
        DataProvider cached = DynamicProxyDecorators.caching(impl, 5000L);

        System.out.println("First call: " + cached.getData()); // 耗时
        System.out.println("Cached call: " + cached.getData()); // 快速
    }
    
}
